package com.java.demo9;

public class Test {
    public static void main(String[] args) {
        Employee parent = new Manager("黎明", 1, 20000, 2000);
        parent.work();
        System.out.println(parent.getName());
        System.out.println(parent.getNumber());
        System.out.println(parent.getSalary());
        //上转下，强制转换
        Manager manager = (Manager) parent;
        System.out.println(manager.getBonus());

        System.out.println("-------------------------------");
        HeadMan headMan  = new HeadMan("小明",2,2000);
        headMan.work();
        System.out.println(headMan.getName());
        System.out.println(headMan.getNumber());
        System.out.println(headMan.getSalary());
    }
}
